#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>

using namespace std;

int arr[500001];

int cmp(int a, int b)
{
	return abs(a) > abs(b);
}

int main(int argc, char const *argv[])
{
	int T;
	scanf("%d", &T);
	//cout << T << endl;
	while(T--)
	{
		int n;
		scanf("%d", &n);

		for (int i = 0; i < n; ++i)
		{
			scanf("%d", &arr[i]);
		}
		
		sort(arr, arr + n, cmp);
		
		int ans = 0;
		int flag;
		flag = arr[0] > 0 ? 1 : -1;

		for (int i = 0; i < n; ++i)
		{
			if(flag * arr[i] > 0)
			{
				ans++;
				flag = -flag;
			}
		}

		printf("%d\n", ans);
	}
	return 0;
}